package com.wskh.eduCms.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wskh.commonUtil.R;
import com.wskh.eduCms.entity.CrmBanner;
import com.wskh.eduCms.service.CrmBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author wskh
 * @since 2021-10-18
 */
@Api("前台使用的controller")
@RestController
@RequestMapping("/eduCms/bannerFront")
@CrossOrigin
public class CrmBannerControllerFront {
    @Autowired
    private CrmBannerService bannerService;

    @ApiOperation(value = "获取所有banner")
    @GetMapping("getAllBanner")
    @Cacheable(key = "'selectIndexList'",value = "banner")
    public R index() {
        List<CrmBanner> list = bannerService.selectIndexList();
        return R.ok().data("list", list);
    }

}

